package com.wing.warehouse.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.common.utils.JsonResult;
import com.wing.warehouse.model.entity.WarehouseShelfSpace;
import com.wing.warehouse.model.request.WarehouseShelfFlatSpaceForm;
import com.wing.warehouse.model.request.WarehouseShelfSpaceForm;
import com.wing.warehouse.model.response.WarehouseShelfSpaceVO;
import com.wing.web.excel.DeviceExcelIn;
import com.wing.web.excel.ShelfSpaceExcelIn;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 仓库货架货位-Service
 *
 * @author
 */
public interface WarehouseShelfSpaceService extends IService<WarehouseShelfSpace> {

    /**
     * 添加
     *
     * @param warehouseShelfSpaceForm
     * @return
     */
    int add(WarehouseShelfSpaceForm warehouseShelfSpaceForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<WarehouseShelfSpaceVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<WarehouseShelfSpaceVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    WarehouseShelfSpaceVO get4appById(Long id);

    int disableByShelfId( Long shelfId);

    int updateShelfSpaceById(WarehouseShelfSpace warehouseShelfSpace);

    WarehouseShelfSpaceVO findByCode(String code);

    /**
     * 查询采购入库产品库位
     * @param skuCode
     * @param warehouseId
     * @return
     */
    List<WarehouseShelfSpaceVO> getShelfSpace(String skuCode, Long warehouseId);

    /**
     * 添加平行库位
     *
     * @param warehouseShelfFlatSpaceForm 仓库货架平面空间形式
     * @return int
     */
    JsonResult addFlat(WarehouseShelfFlatSpaceForm warehouseShelfFlatSpaceForm);


    /**
     * 同步畅捷通数据
     * @return
     */
    JsonResult syncSpaceCjt();


    /**
     * 模板下载
     * @param response
     * @param request
     * @throws IOException
     */
    void template(HttpServletResponse response, HttpServletRequest request) throws IOException;


    /**
     * 货位导入
     * @param list
     */
    void importExcel(List<ShelfSpaceExcelIn> list);

    /**
     * 作废库位
     * @param id
     */
    JsonResult cancel(Long id);

    /**
     * 恢复
     * @param id
     */
    JsonResult recover(Long id);

    WarehouseShelfSpaceVO getWarehouseInfoBySpaceCode(String warehouseShelfSpaceCode);

}
